#include <iostream>
#include <fstream>
#include "Scanner.h"
#include "Parser.h"
#include "Printer.h"
using namespace std;

int main() {
    ifstream f(R"(D:\Code\C_Cpp_code\SyntaxTreeExpand\test.txt)");
    if (!f.is_open()) {
        std::cerr << "Unable to open file" << std::endl;
        return 1;
    }
    string str;
    string full;
    while (getline(f, str)) {
        full += str;
    }
    cout << full << endl;
    Scanner scanner(full + '\n');
    auto tokens = scanner.getTokens();
    for (const auto &token: tokens) {
        cout << token.type << " " << token.str << endl;
    }
    Parser parser(tokens);
    Printer printer(parser);
    printer.print();
    return 0;
}
